package vip.xiaonuo.modular.business.controller;

import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.param.BiIndexData.QueryParam;
import vip.xiaonuo.modular.business.service.IndexDataManageService;

import javax.annotation.Resource;

/**
 * @Description 指标数据管理
 * @Author cy
 * @Date 2022/8/4 14:54
 * @Version 1.0
 */
@Api(tags = "指标数据")
@RestController
public class IndexDataManageController {

    @Resource
    private IndexDataManageService indexDataManageService;

    @ApiOperation("指标图层数据查询")
    @PostMapping("/business/biIndexData/list")
    @BusinessLog(title = "指标图层数据查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData indexDataList(@RequestBody QueryParam param){
//        Object result = indexDataManageService.indexDataList(param);
        JSONArray result = indexDataManageService.queryIndexData(param);
        return new SuccessResponseData(result);
    }

    /**
     * 指标介绍
     * @param param
     * @return
     */
    @PostMapping("/business/indexIntroduce")
    public ResponseData indexIntroduce(@RequestBody QueryParam param){
        Object result = indexDataManageService.indexIntroduce(param);
        return new SuccessResponseData(result);
    }

}
